﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Money.Interfaces;
using Money.Data;
using Money.Entities;

namespace Money.Services
{
    public class CurrencyService : ICurrencyService
    {

        private Money.Data.MoneyManagerDataContext context;

        public CurrencyService()
        {
            context = new Money.Data.MoneyManagerDataContext();
        }

        public List<Currency> GetCurrencies()
        {
            return context.Currencies.ToList<Currency>();
        }

        public Currency GetCurrencyById(int id)
        {
            return context.Currencies.SingleOrDefault<Currency>(c => c.Id == id);
        }

    }
}
